package com.web.exiaodao.business.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.web.exiaodao.business.entity.User;

import java.util.List;


public interface UserRepository extends
		PagingAndSortingRepository<User, Long>,
		JpaSpecificationExecutor<User> {

	public User findByIdAndStatusNot(Long id,Integer status);

	public User findByIdAndStatus(Long id,Integer status);

	public User findById(Long id);

	public User findByMobile(String  mobile);

	public User findByVipOrderNo(String  vipOrderNo);

	//验证手机号是否存在
	public User findTopByMobileAndStatusNot(String mobile, Integer status);

	//验证用户名是否存在
	public User findByUserNameAndStatusNot(String userName,Integer status);

	//登录
	public User findByMobileAndPasswordAndStatusNot(String mobile,String password,Integer status);

	/**
	 * 查询接收推送消息的用户
	 * @param status
	 * @return
	 */
	public List<User> findByStatusNot(Integer status);
}
